import request from '@/utils/request'

// 获取业务受理列表
export const apiGetBusinessList = (data) => {
    return request({
        url: '/dst-business-handle/find/page',
        method: 'post',
        data
    })
}

// 受理业务详情
export const apiBusinessDetails = (_id) => {
    return request({
        url: '/dst-business-handle/get',
        method: 'post',
        data: {
            id: _id
        }
    })
}
// 受理业务
export const apiAcceptBusiness = (data) => {
    return request({
        url: '/dst-business-handle/accept',
        method: 'post',
        data
    })
}

// 拒绝/驳回受理业务
export const apiRejectBusiness = (data) => {
    return request({
        url: '/dst-business-handle/operate',
        method: 'post',
        data
    })
}

// 业务受理-获取设备信息
export const apiGetBusinessDeviceList = (id) => {
    return request({
        url: '/dst-business-handle/get/product',
        method: 'post',
        data: { id }
    })
}

// 检测任务列表
export const apiGetTaskList = (data) => {
    return request({
        url: '/dst-task/find/search',
        method: 'post',
        data
    })
}


// 检测任务详情
export const apiGetTaskDetails = (id) => {
    return request({
        url: '/dst-task/find/detail',
        method: 'post',
        data: {
            id
        }
    })
}



// 检测任务-设备信息
export const apiGetTaskDeviceInfo = (id) => {
    return request({
        url: '/dst-task/find/product-info',
        method: 'post',
        data: {
            id
        }
    })
}

// 检测报告列表
export const apiGetReportList = (data) => {
    return request({
        url: '/dst-detection-report/find/page',
        method: 'post',
        data
    })
}


// 检测报告审批通过
export const apiApproveReportPass = (data) => {
    return request({
        url: '/dst-detection-report/detection/pass',
        method: 'post',
        data
    })
}

// 检测报告审批退回
export const apiApproveReportReturn = (data) => {
    return request({
        url: '/dst-detection-report/report/return',
        method: 'post',
        data
    })
}



// 检测报告批准通过
export const apiRatifyReportPass = (data) => {
    return request({
        url: '/dst-detection-report/approved/pass',
        method: 'post',
        data
    })
}

// 检测报告发放
export const apiRatifyReportGrant = (data) => {
    return request({
        url: '/dst-detection-report/issue',
        method: 'post',
        data
    })
}

// 检测报告归档
export const apiRatifyReportPigeonhole = (data) => {
    return request({
        url: '/dst-detection-report/pigeonhole',
        method: 'post',
        data
    })
}

// 检测报告追回
export const apiRatifyReportTtracking = (data) => {
    return request({
        url: '/dst-detection-report/tracking',
        method: 'post',
        data
    })
}


// 业务受理关联的设备列表
export const apiBusinessDeviceList = (data) => {
    return request({
        url: '/dst-business-handle/get/product/page/list',
        method: 'post',
        data
    })
}



// 业务计划关联的设备列表
export const apiAssignDeviceList = (data) => {
    return request({
        url: '/dst-plan/get/product/page/list',
        method: 'post',
        data
    })
}

// 提交分派
export const apiSubmitAssign = (data) => {
    return request({
        url: '/dst-plan/apportion',
        method: 'post',
        data
    })
}


// 检测记录列表
export const apiGetDetectionRecordList = (data) => {
    return request({
        url: '/dst-detection-record/find/page',
        method: 'post',
        data
    })
}
// 检测流程历史
export const apiGetProcessLog = (data) => {
    return request({
        url: '/dst-process-log/find/page',
        method: 'post',
        data
    })
}


// 检测报告列表
export const apiGetDetectionReportList = (data) => {
    return request({
        url: '/dst-detection-report/find/page',
        method: 'post',
        data
    })
}



// 检测信息确认
export const apiGetSureDetectionInfo = (id) => {
    return request({
        url: '/dst-task/find/app-detail',
        method: 'post',
        data: { id }
    })
}

// 检测条件确认
export const apiGetDetectionSureCondition = (data) => {
    return request({
        url: '/dst-product-condition/find/list',
        method: 'post',
        data
    })
}



// 首次录入检测项分页查询
export const apiGetDetectionItemList = (data) => {
    return request({
        url: '/dbt-detection-result/find/page',
        method: 'post',
        data
    })
}


// 提交检测记录数据
export const apiSubmitRecordInfo = (data) => {
    return request({
        url: '/dbt-detection-result/finish',
        method: 'post',
        data
    })
}

// 检测记录更新
export const apiUpdateDetectionRecord = (data) => {
    return request({
        url: '/dst-detection-record/update',
        method: 'post',
        data
    })
}



// 提交检测记录审核
export const apiRecordSubmiExamine = (id, rebirth) => {
    return request({
        url: '/dst-detection-record/submit/audit',
        method: 'post',
        data: {
            id,
            rebirth
        }
    })
}



// 查看检测报告文件
export const apiGetReportFiles = (id) => {
    return request({
        url: '/dst-detection-report/view/report/' + id,
        method: 'get',
        params: {
            responseType: 'blob'
        }
    })
}


// 查看备忘录文件
export const apiGetMemorandumFile = (id) => {
    return request({
        url: '/dst-task-inform/get/pdf',
        method: 'post',
        data: { id }
    })
}

// 查询备忘录
export const apiGetMemorandumDetails = (id) => {
    return request({
        url: '/dst-task-inform/find/detail',
        method: 'post',
        data: { id }
    })
}


// 新增备忘录
export const apiAddMemorandum = (data) => {
    return request({
        url: '/dst-task-inform/create',
        method: 'post',
        data
    })
}


// 查看中止通知单 PDF
export const apiGetStopNoticeFile = (id) => {
    return request({
        url: '/dst-dc-notice/find/pdf/' + id,
        method: 'get',
        params: {
            responseType: 'blob'
        }
    })
}




// 查看附件列表
export const apiGetAnnex = (id) => {
    return request({
        url: '/dst-detection-record/find/annex',
        method: 'post',
        data: { id }
    })
}
// 新增附件 
export const apiAddAnnex = (data) => {
    return request({
        url: '/dst-detection-record/update/annex',
        method: 'post',
        data
    })
}

// 检测记录详情 
export const apiGetRecordDetails = (id) => {
    return request({
        url: '/dst-detection-record/find/detail',
        method: 'post',
        data: {
            id
        }
    })
}

